class HouseVisit < DeskActionAggregate
  validates_presence_of :house_id
  
  belongs_to :house
  has_one :entrance,
          :class_name => "Entrance",
          :foreign_key => 'desk_action_aggregate_id'
  has_one :exit,
          :class_name => "Exit",
          :foreign_key => 'desk_action_aggregate_id'
          
  def currently_active
    if exit.nil?
      true
    else
      exit.effective_at > Time.now
    end
  end
  
end
